import request from '@/utils/request'
import fileAPI from '@/utils/fileAPI'
export function list(data) {
  return request({
    url: '/device/spare/in/list',
    method: 'post',
    data: data
  })
}
export function remove(data) {
  return request({
    url: '/device/spare/in/delete',
    method: 'post',
    data: { deleteIds: data }
  })
}
export function addOrUpdate(data) {
  return request({
    url: '/device/spare/in/addOrEdit',
    method: 'post',
    data: data
  })
}
export function getInfo(data) {
  return request({
    url: '/device/spare/in/' + data,
    method: 'get'
  })
}
export function importMethod(files) {
  const formData = new FormData()
  for (let i = 0; i < files.length; i++) {
    formData.append('file', files[i], files[i].name)
  }
  return fileAPI({
    url: '/device/spare/in/import',
    method: 'post',
    data: formData
  })
}
export function getUserList(data) {
  return request({
    url: '/device/basicInformation/maintenance/userList',
    method: 'post',
    data: data
  })
}
